#include <bits/stdc++.h>
using namespace std;
#define int long long
int arr[1000100];
int fac[1000100],infac[1000100];
const int mod = 998244353;
typedef long long LL;

int quick_pow(int a, int k, int p)
{
    int res = 1;
    while(k)
    {
        if (k & 1) res = (LL)res * a % p;
        a = (LL)a * a % p;
        k >>= 1;
    }
    return res;
}

void solve(){
    int x;
    cin >> x;
    cout << quick_pow(arr[x] + 1,mod - 2,mod) % mod << ' ';
}

void init()
{
    fac[0] = infac[0] = 1;
    for(int i = 1; i <= 1e6; i ++)
    {
        fac[i] = fac[i - 1] * i % mod;
        infac[i] = infac[i - 1] * quick_pow(i,mod - 2,mod) % mod;
    }
}

signed main(){
    int t = 1;
    cin >> t;
    for(int i = 1; i <= 1e6; i ++)
    {
        int cnt = i;
        while(cnt % 2 == 0)
        {
            arr[i] ++;
            cnt /= 2;
        }
    }
    for(int i = 1; i <= 1e6; i ++)
    {
        arr[i] = arr[i] + arr[i - 1];
        arr[i] %= mod;
    }
    //init();
    while(t--)
    {
        solve();
    }
}